<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script src="//cdn.bootcss.com/fetch/1.0.0/fetch.js"></script>
</head>
<body>
<script>
//    var result = fetch('https://api.github.com');
//function(method,obj){}
var commonData ={
    "head": {
        "userId": "",
        "skey": "",
        "platform": "h5",
        "imei": "xxxxx",
        "appVersion": "1.0",
        "cityId": "0",
        "platformVersion": "4.2",
        "deviceId": "xxxx",
        "channel": "xxx",
        "protoVersion": 1,
        "isPreview":2
    },
    "body": {
        "categoryId": 1,
        "index":1,
        "pageSize":20
    }
}
var result = fetch('http://dev.goldentreewm.com/freeman-web/getProductList',{
              method: "POST",
              body: JSON.stringify(commonData)
              });
    result.then(function(response) {
        console.log('response', response);
        console.log('header', response.headers.get('Content-Type'));
        return response.text()
    }).then(function(text) {
        console.log('got text', text)
    }).catch(function(ex) {
        console.log('failed', ex)
    });





</script>
</body>
</html>